package action;

public class CopyOfTest {

	public static void main(String[] args) {

		String zhi = "01,02,03,04,05,06,07,08";
		CopyOfTest test = new CopyOfTest();
		System.out.println(test.change(zhi));
		System.out.println(test.change1(zhi));
	}

	public String change(String zhi) {
		String newzhi = "";
		if (zhi.indexOf("|") > 0) {
			return zhi;
		} else {
			String[] sz = zhi.split(",");
			newzhi = sz[0] + "," + sz[1] + "," + sz[2] + "," + sz[3] + ","
					+ sz[4] + "," + sz[5] + "," + sz[6] + "|" + sz[7];
			return newzhi;
		}

	}

	public String change1(String zhi) {
		String newzhi = "";
		if (zhi.indexOf("|") > 0) {
			return zhi;
		} else {
			int len = zhi.length() - 3;
			String zz = zhi.substring(0, len);
			String z = zhi.substring(len).replace(",", "|");
			newzhi = zz + z;
			return newzhi;
		}
	}

}
